package com.ctgu.springstart.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class User {

    private Integer id;

    private String username;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer age;

    @JsonProperty("account")
    private String phone;

    @JsonIgnore
    private String email;

//    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", locale = "zh", timezone = "GMT+8")
//    private Date createTime;

//    public User(Integer id, String username, Integer age,
//                String phone, String email) {
//        this.id = id;
//        this.username = username;
//        this.age = age;
//        this.phone = phone;
//        this.email = email;
//        this.createTime = new Date();
//    }

//    public Date getCreateTime() {
//        return createTime;
//    }
//
//    public void setCreateTime(Date createTime) {
//        this.createTime = createTime;
//    }

//    @Override
//    public String toString() {
//        return "User{" +
//                "id=" + id +
//                ", username='" + username + '\'' +
//                ", age=" + age +
//                ", phone='" + phone + '\'' +
//                ", email='" + email + '\'' +
////                ", createTime=" + createTime +
//                '}';
//    }
}
